package com.factory.pattern.service;

import com.factory.pattern.service.impl.ColorFactory;
import com.factory.pattern.service.impl.ShapeFactory;

/**
 * @author chenchen
 * @description
 * @date 2023/11/17 11:38
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        throw new UnsupportedOperationException();
    }
}

